﻿#ifndef PURCHASELOG_H
#define PURCHASELOG_H

#include <common/baseeditor.h>
#include "pl_additem.h"

namespace Ui {
class PurchaseLog;
}

class PurchaseLog : public BaseEditor
{
    Q_OBJECT

public:
    explicit PurchaseLog(QWidget *parent = nullptr);
    ~PurchaseLog();

    void updateCategory();
    void generateMenu();
    void updateView();
    void setHeaderData();
    void setHeaderDataL();
    void openUrl();
    void copyNewItem();
    void newItem();
    void removeItem();
    void generateSummary();
    void updateTodayView();

protected:
    void keyPressEvent(QKeyEvent *event);

private slots:
    void on_keyword_returnPressed();
    void on_listView_doubleClicked(const QModelIndex &index);

private:
    Ui::PurchaseLog *ui;

    QString selectCategory;
    QStringList categories;
    QStringListModel *listModel;
};

#endif // PURCHASELOG_H
